<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>客户订单详情</title>
    <c:import url="../../header.jsp"/>
    <link rel="stylesheet" href="${rootUrl}/static/css/time-status-color.css?v=${version}">
    <style>
        table.crm-table.cell-border tbody td{
            white-space: nowrap;
        }
    </style>
</head>
<body>
<div class="body-main">

    <%--基本信息 start--%>
    <div class="finan-panel">
        <div class="finan-tit">
            <b>客户基础信息</b>
            <div class="panel-opt">
            </div>
        </div>
        <div class="panel-table">
            <form id="cus_detail_form">
                <table class="layui-table table-info">
                    <tbody>
                    <tr>
                        <th>客户名称：</th>
                        <td>
                            <p>${customer.name}</p>
                        </td>
                        <th>联系电话：</th>
                        <td>
                            <input type="hidden" id="cusPhone" value="${customer.number}"/>
                            <p id="hiddenNumber" style="display:inline-block"></p>

                            <d:hasUrlAuth authCode="ZZSC_SEE_PHONE">
                                <a href="javascript:void(0)" class="opt-icon look"
                                   onclick="seeNumber(this,'${customer.id}','2','2')"></a>
                            </d:hasUrlAuth>

                            <c:if test="${not empty customer.number}">
                                <a href="javascript:void(0)" class="opt-icon-a icon1"
                                   onclick="callPhoneByCustomer('${customer.id}','${customer.name}')"></a>
                            </c:if>
                        </td>
                        <th>性别：</th>
                        <td>${customer.sex}</td>
                        <th>生日：</th>
                        <td>${customer.birthday}</td>
                    </tr>
                    <tr>
                        <th>身份证号码：</th>
                        <td>
                            <span>
                                <c:if test="${fn:length(customer.idCard) == 18}">
                                    ${fn:substring(customer.idCard,0,1)}********${fn:substring(customer.idCard,fn:length(customer.idCard)-1,fn:length(customer.idCard))}
                                </c:if>
                            </span>
                            <d:hasUrlAuth authCode="ZZSC_SEE_ID_CARD">
                                <a href="javascript:void(0)" class="opt-icon look"
                                   onclick="seeNumber(this,'${customer.idCard}','1','2')"></a>
                            </d:hasUrlAuth>
                        </td>
                        <th>户籍地址：</th>
                        <td>${customer.houseRegister}</td>
                        <th>客户年龄：</th>
                        <td>${customer.age}</td>
                        <th>业务地区：</th>
                        <td><span>${customer.businessArea}</span></td>
                    </tr>
                    <tr>
                        <th>客户角色：</th>
                        <td>${customer.customerType}</td>
                        <th>来源方式：</th>
                        <td>${customer.origin}</td>
                    </tr>
                    <tr>
                        <th>客户备注：</th>
                        <td colspan="7">${customer.lastFollowContent}</td>
                    </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>

    <div class="table-conter">
        <span >订单明细</span>
        <div class="fr">
            <span class="bgBigRed">退单</span>
            <span class="bgBlueGreen">合同超期</span>
            <span class="bgRed">订单超期</span>
            <span class="bgBlue">节点超期</span>
            <span class="bgOldGreen">订单暂停</span>
            <span class="bgGray">订单中止</span>
        </div>
    </div>
    <div class="table-body">
        <!--表格 start-->
        <table class="cell-border crm-table columnsHidden dataTable">
            <thead>
            <tr>
                <th width="50">序号</th>
                <th>生产事业部</th>
                <th>生产订单编号</th>
                <th>订单编号</th>
                <th>合同编号</th>
                <th>完成节点</th>
                <th>预计/完成时间</th>
                <th>业务类型</th>
                <th>订单产品</th>
                <th>签单时间</th>
                <th>最新备注</th>
                <th>签单商务</th>
                <th>流程人员</th>
                <th>协单人员</th>
                <th>企业名称</th>
                <th>合同金额</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
                <c:forEach items="${customerInfoList}" var="key" varStatus="item">
                    <c:choose>
                        <c:when test="${key.status=='ZZSC_STATE_SCPROORDER_CODE8' || key.status=='ZZSC_STATE_SCPROORDER_CODE9' || key.status=='ZZSC_STATE_SCPROORDER_CODE10'}">
                            <tr style="background-color:#ff6f6f ">
                        </c:when>
                        <c:when test="${key.contractTimeStatus=='OVERDUE_STATE2'}">
                            <tr style="background-color:#66cccc ">
                        </c:when>
                        <c:when test="${key.orderTimeStatus=='OVERDUE_STATE2'}">
                            <tr style="background-color:#fda0c3 ">
                        </c:when>
                        <c:when test="${key.nodeTimeStatus=='OVERDUE_STATE2'}">
                            <tr style="background-color:#bbe1ff ">
                        </c:when>
                        <c:when test="${key.status=='ZZSC_STATE_SCPROORDER_CODE7'}">
                            <tr style="background-color:#7662ea ">
                        </c:when>
                        <c:when test="${key.status=='ZZSC_STATE_SCPROORDER_CODE18'}">
                            <tr style="background-color:#999999 ">
                        </c:when>
                        <c:otherwise>
                            <tr>
                        </c:otherwise>
                    </c:choose>
                        <td>${item.index+1}</td>
                        <td>${key.productOrgName}</td>
                        <td>
                            <a href="javascript:;"  class="layui-table-link" onclick="openOrderInfoDetail('${key.scProductOrderNo}','${key.id}')" >
                                ${key.scProductOrderNo}
                            </a>
                        </td>
                        <td>
                            <a href="javascript:;"  class="layui-table-link" onclick="openBusinessDetail('${key.orderNo}','${key.orderId}')" >
                                    ${key.orderNo}
                            </a>
                        </td>
                        <td>${key.contractNo}</td>
                        <td>${key.latestEndNodeName}</td>
                        <td>
                            <c:choose>
                                <c:when test="${key.status=='ZZSC_STATE_SCPROORDER_CODE10'}">
                                    ${key.returnAbandonCompleteTime}
                                </c:when>
                                <c:when test="${key.status=='ZZSC_STATE_SCPROORDER_CODE11' || key.status=='ZZSC_STATE_SCPROORDER_CODE15' || key.status=='ZZSC_STATE_SCPROORDER_CODE13'}">
                                    ${key.latestEndNodeTime}
                                </c:when>
                                <c:otherwise>
                                    ${key.orderEndTime}
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td>${key.businessProductName}</td>
                        <td>${key.productName}</td>
                        <td>${key.signTime}</td>
                        <td><div class="line2" style="min-width: 120px" title="${key.lastRemark}">${key.lastRemark}</div><p>${key.lastUser}</p><p>${key.lastRemarkTime}</p></td>
                        <td>${key.signUserName}<p>${key.signUserOrgName}</p></td>
                        <td>${key.flowUserName}</td>
                        <td><div class="line2" style="min-width: 120px" title="${key.assistUserName}">${key.assistUserName}</div></td>
                        <td>${key.companyName}</td>
                        <td>${key.money}</td>
                        <td><a href=javascript:void(0) class="layui-table-link" onclick="remarkLayer('${key.id}')"><span style="color: #0066ff ">备注</span></a></td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
        <!--表格 end-->
    </div>
</div>
<c:import url="/WEB-INF/jsp/footer.jsp"/>
<script type="text/javascript"
        src="${basePath}/static/js/choose.extend.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/production/sc_common.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/common/call_common.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/inprocess/inprocess_list.js?v=${version}"></script>
<script src="${rootUrl}/static/js/zzsc/common/sc_chooseUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(function () {
        var number = $("#cusPhone").val();
        var hidenumber=hidePhone(number);
        $("#hiddenNumber").html(hidenumber);
    });
</script>
</body>

</html>